package com.zeei.ems.base.controller;

import com.zeei.ems.base.result.ResultRowsVO;
import com.zeei.ems.base.service.DeptInfoService;
import com.zeei.ems.base.service.RiverService;
import com.zeei.ems.base.tree.TreeNodeVO;
import com.zeei.ems.base.vo.DeptInfoVO;
import com.zeei.ems.base.vo.QueryDeptParamVO;
import com.zeei.ems.base.vo.RiverParam;
import com.zeei.ems.base.vo.RiverVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "流域接口")
@Controller
@RequestMapping("/ems/river")
public class RiverController extends BasicController {

	@Resource
	RiverService riverService;

	@ApiOperation(value = "查询流域树形列表")
	@RequestMapping(value = "/list", method = RequestMethod.POST)
	@ResponseBody
	public ResultRowsVO<TreeNodeVO<RiverVO>> queryDept(RiverParam riverParam) {
		List<TreeNodeVO<RiverVO>> list = riverService.queryRiverByCondition(riverParam);
		return this.createResultRowsVO(list, true, null, list.size());
	}
}
